<!DOCTYPE html>
<html>

<head>
    <title>宝贝呢</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
    <link rel="stylesheet" type="text/css" href="styles/icons.css" />
    <link rel="stylesheet" type="text/css" href="styles/af.ui.css" />
    <link rel="stylesheet" type="text/css" href="styles/layer.css" />
    <link rel="stylesheet" type="text/css" href="styles/layer_diy.css" />
    <!-- <link rel="stylesheet" type="text/css" href="styles/label.css" />-->

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/jquery.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/fastclick.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/appframework.ui.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/socket.io.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/vue.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/vue-validator.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/layer.js"></script>

    <!-- <script type="text/javascript" charset="utf-8" src="scripts/getpagesize.js"></script>-->
    <script type="text/javascript" charset="utf-8" src="scripts/comm.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/login.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/user.js"></script>
    <script type="text/javascript" charset="utf-8" src="scripts/device.js"></script>
    <!-- <script type="text/javascript" charset="utf-8" src="scripts/notification_plugin.js"></script>-->
    <script type="text/javascript" charset="utf-8" src="scripts/bmapgetscript.js"></script>
<!--     <script type="text/javascript" id="BmapId" src="http://api.map.baidu.com/api?v=2.0&ak=DCRGgn4Ow9sUHfGfsOveLCey"></script>-->
    <style>
        .afToast.warning {
        background: rgba(254, 254, 254, 0.98);
        color: rgb(8, 8, 8);
        margin: 0px auto;
        vertical-align: middle;
        }
    </style>
</head>

<body onload="socket.connect();">
<div id="afui">
    <div id="mainView" class="view">
        <header>
            <a id="menuBtn" href="#" class="menuButton" data-left-menu="left" data-transition="push"></a>
            <h1></h1>
            <!--<a id="addBtn" href="#addDevice" class="addButton"></a>-->
            <a id="addBtn" href="javascript: addDevice1();" class="addButton"></a>
        </header>
        <div class="pages">
<!--            <div class="panel active" id="firstPanel"></div>-->
            <!-- 我的终端 -->
            <div class="panel active" id="main" data-title="我的终端">
                <script type="text/javascript">
                            $.afui.ready(function() {
                                $('#main').on('panelbeforeload', function(e) {
                                 $.afui.setBackButtonVisibility(false);
                                    $("#menuBtn").show();
                                    $("#addBtn").show();
                                    uBandTerminal_panel=true;
                                    if(isConnected){
                                             $("#uBandTerminal_comm_id").hide();

                                             if(!uBandTerminal_flag){
                                              // 加载我的终端
                                                    sendCmd({
                                                       c : "uBandTerminal",
                                                       id : localStorage.getItem("loginUser").split(",")[0],
                                                       type : 5
                                                   });
                                                    uBandTerminal_flag = true;
                                                    //Device.showMask_blockUI();
                                                    overTimeCallback_time_2("deviceList","uBandTerminal_comm_id",10000);
                                             }
                                    }else{
                                            if($("#deviceList").text().length != 0){
                                                console.log("isConnected1:"+isConnected);
                                                           console.log("index没网里面不为空："+$("#deviceList").text().length);
                                                                $("#uBandTerminal_comm_id").hide();
                                                                uBandTerminal_flag = false;
                                            }else{
                                                console.log("isConnected2:"+isConnected);
                                                console.log("没网里面为空："+$("#deviceList").text());
                                                //$("#uBandTerminal_comm_id").show();
                                                $("#uBandTerminal_comm_id").hide();
                                                if(!uBandTerminal_flag){        
                                                // 加载我的终端
                                                        sendCmd({
                                                           c : "uBandTerminal",
                                                           id : localStorage.getItem("loginUser").split(",")[0],
                                                           type : 5
                                                       });
                                                        uBandTerminal_flag = true;
                                                Device.showMask_blockUI();
                                                overTimeCallback_time_2("deviceList","uBandTerminal_comm_id",10000);
                                                }
                                            }
                                    }


                                        var alias = "";
                                        var idTostring =localStorage.getItem("loginUser").split(",")[0].split("-");
                                        //alert(idTostring.length);
                                            for(var i =idTostring.length;i>0;i--){
                                                alias = idTostring[i-1] + alias;

                                            }
                                        console.log("别名"+alias);
                                        //极光初始化，设置别名
                                       window.plugins.jPushPlugin.init();
                                      //var alias="2c57b56c981f4c69b55180c301a1f49c"
                                       window.plugins.jPushPlugin.setAlias(alias);

                                });
                                $('#main').on('panelload', function(e) {
                                    // 控制按钮显示
                                    $.afui.setBackButtonVisibility(false);
                                    $("#menuBtn").show();
                                    $("#addBtn").show();
                                    uBandTerminal_panel=true;
                                });
                             });
                        </script>
                <div id="uBandTerminal_comm_id"  style="display: none;">
                    <br>
                    <a style="color: #333;float: left; text-align:center; font-size: 18px;">加载失败，</a>
                    <a  style="color: #0088D1;font-size: 18px;text-decoration:underline" href="javascript: uBandTerminal_comm();">重试</a>
                </div>
                <ul id="deviceList" class="list"></ul>
                <div  style="text-align:center; color:#0088d1; margin-top: 15px; padding: 10px;margin: 0px -10px -20px -20px;background-color:#fff;" >
                </div>

            </div>
            <!-- 添加终端 -->
            <div class="panel" id="addDevice" data-title="添加新终端">
                <script type="text/javascript">
                            $('#addDevice').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                                $("#main").removeClass('active');
                            });
                        </script>
                <br>
                <div class="card">
                    <label for="device-name">名&nbsp;&nbsp;&nbsp;称&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input id="device-name" type="text" placeholder="请输入终端名称" maxlength="10"/>
                    <label for="device-phone">终端号码</label>
                    <input id="device-phone" type="tel" placeholder="请输入终端内SIM卡号码" maxlength="20" />
                    <label for="device-imei">IMEI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input id="device-imei" type="text" placeholder="请输入终端IMEI号" maxlength="40" />
                    <label for="device-password">密&nbsp;&nbsp;&nbsp;码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input id="device-password" type="password" placeholder="请输入终端密码" maxlength="4"/>
                    <a id="bandBtn" class='button block blue' href='javascript: bandDevice();'>绑定终端</a>
                </div>
            </div>
            <!-- 亲情号码 -->
            <div class="panel" id="guardian" data-title="亲情号码设置">
                <script type="text/javascript">
                            $('#guardian').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                                $("#main").removeClass('active');
                                sendCmd({
                                    c : "uRelateNumber",
                                    imei : $("#guardian-imei").val(),
                                    type : 1
                                });
                            });
                        </script>
                <br>
                <div class="card">
                    <input type="hidden" id="guardian-imei" />
                    <!--亲情号码设置 -->
                    <div id="guardianContent"></div>
                    <a id="guardianBtn" class='button block blue' href='javascript: guardian();'>确定</a>
                </div>
            </div>
            <!-- 白名单设置 -->
            <div class="panel" id="white" data-title="白名单设置">
                <script type="text/javascript">
                            $('#white').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                                $("#main").removeClass('active');
                                sendCmd({
                                    c : "uRelateNumber",
                                    imei : $("#white-imei").val(),
                                    type : 3
                                });
                            });
                        </script>
                <br>
                <div class="card">
                    <input type="hidden" id="white-imei" />

                    <div id="whiteContent"></div>
                    <a id="whiteBtn" class='button block blue' href='javascript: white();'>确定</a>
                </div>
            </div>
            <!-- 修改终端资料 -->
            <div class="panel" id="updateInfo" data-title="修改终端资料">
                <script type="text/javascript">
                            $('#updateInfo').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                                $("#main").removeClass('active');
                            });
                        </script>
                <br>
                <div class="card">
                    <input type="hidden" id="updateInfo-imei" />
                    <input type="hidden" id="updateInfo-pwd" />
                    <label for="updateInfo-name">终端名称</label>
                    <input id="updateInfo-name" type="text" maxlength="10" />
                    <label for="updateInfo-rfid" style="display: none;">RFID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input id="updateInfo-rfid"   style="display: none;" type="text" placeholder="请输入终端RFID" maxlength="8" />
                    <label for="updateInfo-phone">终端号码</label>
                    <input id="updateInfo-phone" type="number" placeholder="请输入终端内的SIM卡号码" oninput="if(value.length>20)value=value.slice(0,20)"/>
                    <a id="updateInfoBtn" class='button block blue' href='javascript: updateInfo();'>确认</a>
                </div>
            </div>
            <!-- 修改终端密码 -->
            <div class="panel" id="updatePwd" data-title="修改终端密码">
                <script type="text/javascript">
                            $('#updatePwd').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                            });
                        </script>
                <br>
                <div class="card">
                    <input type="hidden" id="updatePwd-imei" />
                    <label for="device-oldPassword">原密码</label>
                    <input id="device-oldPassword" type="password" placeholder="请输入原终端密码" maxlength="4" />
                    <label for="device-newPassword">新密码</label>
                    <input id="device-newPassword" type="password" placeholder="请输入新的密码(4位)" maxlength="4"/>
                    <label for="device-rePassword">确认密码</label>
                    <input id="device-rePassword" type="password" placeholder="请再次输入新密码" maxlength="4"/>
                    <a id="updatePwdBtn" class='button block blue' href='javascript: updatePassword();'>确认</a>
                </div>
            </div>
            <!-- 设置 -->
            <div class="panel" id="setting" data-title="设置">
                <script type="text/javascript">
                            $('#setting').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                                // 初始化值
                                var data = localStorage.getItem("loginUser").split(",");
                                var logo = "http://" + host + "/images/upload/" + data[1] + ".jpg";
                                $("#logoImg").attr("src", logo);
                                $("#setting-name").val(data[2]);
                                $("#setting-sex").val(data[3]);
                                var infoData = localStorage.getItem(data[0]);
                                if (infoData != null) {
                                    var info = infoData.split(",-,");
                                    var open = info[0] == 'true';
                                    $("#setting-notice").prop("checked", open);
                                    $("#setting-sound").prop("checked", info[1] == 'true');
                                    $("#setting-vibrate").prop("checked", info[2] == 'true');
                                    $("#logoImg").attr("src", info[3]);
                                    $("#setting-name").val(info[4]);
                                    $("#setting-sex").val(info[5]);
                                    if (!open) {
                                        $('#li-notice-1').css("display", "none");
                                        $('#li-notice-2').css("display", "none");
                                        $('#li-notice-3').css("display", "none");
                                    } else {
                                        $('#li-notice-1').css("display", "block");
                                        $('#li-notice-2').css("display", "block");
                                        $('#li-notice-3').css("display", "block");
                                    }
                                } else {
                                    $("#setting-notice").prop("checked", true);
                                    $("#setting-sound").prop("checked", true);
                                    $("#setting-vibrate").prop("checked", true);
                                    $('#li-notice-1').css("display", "block");
                                    $('#li-notice-2').css("display", "block");
                                    $('#li-notice-3').css("display", "block");
                                }
                            });
                            $('#setting').on('panelload', function(e) {
                            $("#main").removeClass('active');
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                            function changeNoticeDisplay() {
                                if (!$('#setting-notice').prop('checked')) {
                                    $('#setting-sound').prop('checked', false);
                                    $('#setting-vibrate').prop('checked', false);
                                    $('#li-notice-1').css("display", "none");
                                    $('#li-notice-2').css("display", "none");
                                    $('#li-notice-3').css("display", "none");
                                } else {
                                    $('#li-notice-1').css("display", "block");
                                    $('#li-notice-2').css("display", "block");
                                    $('#li-notice-3').css("display", "block");
                                }
                            }
                        </script>
                <ul class="list">
                    <li style="height: 80px;">
                        <div style="margin-top: 15px; width: 80px;">
                            &nbsp;&nbsp;头像
                        </div>
                        <div style="float: right; margin: -42px 12px 0px 0px; width: 60px;">
                            <img id="logoImg" onerror="javascript: this.src = 'images/logo.jpg';" style="position: relative; width: 60px; height: 60px; border-radius: 50%;"/>
                            <input id="upload" type="file" style="position: absolute; z-index: 99; opacity: 0; float: right; top: 15px; right: 40px; height: 60px; width: 60px;"
                                   onchange="javascript: preview(this);" accept="image/*" />
                        </div>
                    </li>
                    <li>
                        &nbsp;&nbsp;昵称
                        <div style="float: right; margin-right: 15px;">
                            <input id="setting-name" type="text" maxlength="10" style="width: 160px; padding-right: 10px; margin-top: -8px; border: 0; text-align: right;"value="" />
                        </div>
                    </li>
                    <!--<li>
                        &nbsp;&nbsp;性别
                        <div style="float: right; margin-right: 15px;">
                            <select id="setting-sex" style="width: 40px; margin-top: -8px; border: 0;">
                                <option value="false">男</option>
                                <option value="true">女</option>
                            </select>
                        </div>
                    </li>
                    <li style="background-color: #0088d1; color: #fff; padding-top: 3px; padding-bottom: 3px;">
                        &nbsp;&nbsp;通知设置
                    </li>
                    <li>
                        &nbsp;&nbsp;通知消息
                        <div style="float: right; margin-right: 20px;">
                            <input id="setting-notice" type="checkbox" class="toggle" onchange="javascript: changeNoticeDisplay();" />
                            <label for="setting-notice" data-on="" data-off="" style="margin-top: -5px;"><span></span> </label>
                        </div>
                    </li>
                    <li id="li-notice-1" style="background-color: #0088d1; color: #fff; padding-top: 3px; padding-bottom: 3px;">
                        &nbsp;&nbsp;通知方式设置
                    </li>
                    <li id="li-notice-2">
                        &nbsp;&nbsp;声音
                        <div style="float: right; margin-right: 20px;">
                            <input id="setting-sound" type="checkbox" class="toggle" />
                            <label for="setting-sound" data-on="" data-off="" style="margin-top: -5px;"><span></span> </label>
                        </div>
                    </li>
                    <li id="li-notice-3">
                        &nbsp;&nbsp;振动
                        <div style="float: right; margin-right: 20px;">
                            <input id="setting-vibrate" type="checkbox" class="toggle" />
                            <label for="setting-vibrate" data-on="" data-off="" style="margin-top: -5px;"><span></span> </label>
                        </div>
                    </li>-->
                </ul>
                <a id="settingBtn" class='button block blue' href='javascript: setting();'>保存设置</a>
                <a class='button block blue' href='#modifyPassword'>修改密码</a><a class='button block blue' href='javascript: logout();'>退出登录</a>
            </div>
            <!-- 修改密码 -->
            <div class="panel" id="modifyPassword" data-title="修改密码">
                <script type="text/javascript">
                            $('#modifyPassword').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                            });
                        </script>
                <br>
                <div class="card">
                    <label for="modify-oldPassword">原密码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input maxlength="20" id="modify-oldPassword" type="password" placeholder="请输入原始密码" />
                    <label for="modify-newPassword">新密码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <input maxlength="20" id="modify-newPassword" type="password" placeholder="请输入新的密码(6-20位)"/>
                    <label for="modify-rePassword">确认密码</label>
                    <input id="modify-rePassword" type="password" maxlength="20" placeholder="请再次输入新密码" />
                    <a id="modifyPwdBtn" class='button block blue' href='javascript: modifyPassword();'>确认</a>
                </div>
            </div>
            <!-- 家庭成员 -->
            <div class="panel" id="family" data-title="家庭成员">
                <script type="text/javascript">
                            $('#family').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                                // 加载家庭成员
                                sendCmd({
                                    c : "uRelation",
                                    id : localStorage.getItem("loginUser").split(",")[0],
                                    type : 1
                                });
                            });
                            $('#family').on('panelload', function(e) {
                            $("#main").removeClass('active');
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                        </script>
                <ul id="relationList" class="list"></ul>
                <div  style="padding: 10px ; margin: -10px;width: 106%; background-color:#fff; ">
                    <a id="inviteBtn" class='button block blue' href='#family-invite'>邀请家庭成员</a>
                </div>
            </div>
            <!-- 邀请家庭成员 -->
            <div class="panel" id="family-invite" data-title="邀请家庭成员">
                <script type="text/javascript">
                            $('#family-invite').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#menuBtn").hide();
                                $("#addBtn").hide();
                            });
                        </script>
                <br />
                <input id="family-name" type="text" maxlength="20" placeholder="成员名称" />
                <input id="family-mobile" type="tel" maxlength="20" placeholder="电话号码" />
                <a class='button block blue' href='javascript: addRelation();'>发送邀请</a>
            </div>
            <!-- 帮助 -->
            <div class="panel" id="help" data-title="帮助">
                <script type="text/javascript">
                            $('#help').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                            $('#help').on('panelload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                        </script>
                <ul class="list" style="margin: 10px;">
                    <li style="text-align: center; border:0;">
                        <img src="images/product.jpg" style="max-width: 120px;" />
                    </li>
                    <li style="border:0;">
                        功能介绍：&nbsp;本产品是集亲情通话、校园一卡通、SOS紧急呼救、GPS/LBS定位、轨迹跟踪、电子围栏等多功能于一体的高端时尚儿童手机。
                        <br />
                        <br />
                        ● &nbsp;&nbsp;GPS/LBS定位 手机/电脑查询位置功能
                        <br />
                        ● &nbsp;&nbsp;亲情通话功能
                        <br />
                        ● &nbsp;&nbsp;AGPS辅助快速定位远程监控
                        <br />
                        ● &nbsp;&nbsp;电子围栏等功能
                        <br />
                        ● &nbsp;&nbsp;SOS紧急求助
                        <br />
                        ● &nbsp;&nbsp;监听功能
                    </li>
                </ul>
            </div>
            <!-- 关于 -->
            <div class="panel" id="about" data-title="关于">
                <script type="text/javascript">
                            $('#about').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                            $('#about').on('panelload', function(e) {
                            $("#main").removeClass('active');
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#menuBtn").show();
                                $("#addBtn").hide();
                            });
                        </script>
                <br>
                <div class="card" style="text-align: center;">
                    <img src="images/logo.png" />
                    <br />
                    <br />
                    <span style="color: #999; font-weight: bold; font-size: 18px;">宝贝呢 &nbsp;&nbsp;V1.5.4</span>
                    <div style="margin-top: 15px; text-align: left; line-height: 22px; color: #333;">
                        亲爱的用户：
                        <br />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您好！本产品仅适用于我司提供的消费类电子产品，包括但不限于：功能手机、智能学生卡、手表手机、定位终端以及相关的网站、产品和服务。对本产品做以下声明：
                        <br />
                        1.本产品只能用于业务允许范围内，用户不得随意利用从事违法活动，本公司不承担由此引起的任何法律责任。

                        <br />
                        2.本产品的定位功能使用会受到多种外界因素影响，如关机、无信号、欠费等因素。本公司不承诺每次可以定位成功。如果定位不成功，本公司只负责协助排查原因，并不承担由于定位不成功或者定位误差造成的其它损失及后果的责任。
                        <br />
                        3.本产品带SOS键报警功能提示信息的仅作为提醒亲友，由于用户使用不当出现误报警或引起的恐慌等一切后果，本公司不承担由此引起的任何法律责任。
                        <br />
                        <br />
                        服务热线： <a href="javascript: self.location = 'tel://4008597297';">4008-597-297</a>
                    </div>
                </div>
            </div>
        </div>
        <!-- 左侧菜单 -->
        <nav id="left">
            <div class="view active" id="navView">
                <div class="pages">
                    <div class="panel active" id="menu">
                        <ul class="list" style="color: #0088D1;">
                            <li style="padding-left: 60px; border: 0;"><img id="logoImg-menu" onerror="javascript: this.src = 'images/logo.jpg';" style="width: 60px; height: 60px; margin: 10px 0px 5px 10px; border-radius: 50%;"/>
                                <br />
                                <span id="name-menu" style="width: 100%; display: block; text-align: center; margin-left: -20px;"></span>
                            </li>
                            <li style="padding-left: 30px; border: 0;">
                                <a href="#main" class="icon location big">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我的终端</a>
                            </li>
                            <li style="padding-left: 30px; border: 0;">
                                <a href="#setting" class="icon settings big">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设置</a>
                            </li>
                            <li style="padding-left: 30px; border: 0;">
                                <a href="#family" class="icon home big">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;家庭成员</a>
                            </li>
                            <!--
                            <li style="padding-left: 30px; border: 0;"><a href="#help"
                            class="icon question big">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;帮助</a></li>
                            -->
                            <li style="padding-left: 30px; border: 0;">
                                <a href="#about" class="icon info big">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关于</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </nav>
    </div>
    <div id="deviceView" class="view">
        <header>
            <a id="backBtn" class="backButton2 back" href="javascript: backToMain();">返回</a>
            <h1></h1>
            <a id="addBtn2" href="javascript: addCircle();" class="addButton" style="display: none;"></a>
        </header>
        <div class="pages">
            <!-- 定位 -->
            <div class="panel" id="location">
                <script type="text/javascript">
                            // 绑定
                        //  new Vue(Device.location);
                          $('#location').on('panelbeforeload', function(e) {
                              // 控制按钮显示
                              $.afui.setBackButtonVisibility(false);
                              $("#backBtn").show();
                              uBandTerminal_panel=false;
                          $.afui.setTitle("定位");
                          IMEI1=localStorage.getItem("device").split(",")[0];
                         div_loc_showloading(IMEI1);
                          
                       /*    if(isConnected){
                        	  sendCmd({
                           		c : "uGetGPS",
                           		imei :localStorage.getItem("device").split(",")[0]
                           	}); 
                     }else{
                         if (localStorage.getItem("device") != null) { 
                             var device1 =localStorage.getItem("device").split(",");
                           	 console.log("location3");
                           	 localStorage_GPS(device1); 
                         }else{
                        	 map3.clearOverlays();
                             var lng1=Math.round(31.0417850000 * 1000000) / 1000000;
                             var lat1=Math.round(112.2058430000 * 1000000) / 1000000;
                                 console.log("lng:"+lng1);
                                 console.log("lat:"+lat1);
                             var point=new BMap.Point(lat1,lng1);
                                 map3.centerAndZoom(point, 16);
                        	 
                         } 
                     }*/
                        	 
                        	 
                          });
                          
                          $('#location').on('panelload', function(e) {
                              // 控制按钮显示
                              $.afui.setBackButtonVisibility(false);
                              $("#backBtn").show();
                              uBandTerminal_panel=false;
                              // 显示当前终端
                              $.afui.setTitle(Device.currentName());
                              if (Device.isIoTCard()) {
                                  $('#dialLink').hide();
                              }
                              IMEI1=localStorage.getItem("device").split(",")[0];
                              div_loc_showloading(IMEI1);
                       
                             if (localStorage.getItem("device") != null) { 
                                 var device1 =localStorage.getItem("device").split(",");
                               	 console.log("location3");
                               	 localStorage_GPS(device1); 
                             }else{
                            	 map3.clearOverlays();
                                 var lng1=Math.round(31.0417850000 * 1000000) / 1000000;
                                 var lat1=Math.round(112.2058430000 * 1000000) / 1000000;
                                     console.log("lng:"+lng1);
                                     console.log("lat:"+lat1);
                                 var point=new BMap.Point(lat1,lng1);
                                     map3.centerAndZoom(point, 16);
                             }
                         
                       	  sendCmd({
                         		c : "uGetGPS",
                         		imei :localStorage.getItem("device").split(",")[0]
                         	});
                       	  
                          });  
                          
                        </script>

            </div>
            <script id="location-tools-script" type="text/html">
                <div id="location-tools">
                    <style>
                        .spinner {
                        width: 48px;
                        height: 48px;
                        margin: -100px -5px 52px 0px;
                        background-color: #0088d1;
                        border-radius: 100%;
                        -webkit-animation: scaleout 1.0s infinite ease-in-out;
                        animation: scaleout 1.0s infinite ease-in-out
                        }

                        @-webkit-keyframes scaleout {
                        0% {
                        -webkit-transform: scale(0.0)
                        }
                        100% {
                        -webkit-transform: scale(1.0);
                        opacity: 0
                        }
                        }

                        @keyframes scaleout {
                        0% {
                        transform: scale(0.0);
                        -webkit-transform: scale(0.0)
                        }
                        100% {
                        transform: scale(1.0);
                        -webkit-transform: scale(1.0);
                        opacity: 0
                        }
                        }
                        .singleloc {
                        margin-right: -5px;
                        margin-top: 5px;
                        border-radius: 45px;
                        background-color: rgba(254, 254, 254, 0.9);
                        width: 48px;
                        height: 48px;
                        }
                        .singleloc img {
                        width: 25px;
                        height: 35px;
                        margin: 8px 10px 10px 12px;
                        }

                    </style>
                    <div class="singleloc">
                        <img src="images/loc.png" @click="callLocate" />
                    </div>
                    <div class="singleloc">
                        <img src="images/query.png" @click="callQueryTrack" style="width: 30px;" />
                    </div>
                    <div class="singleloc" v-show="isShowFollow" style="display: none;">
                        <img src="images/follow.png" @click="callFollowing" style="width: 30px;margin-left: 10px;"/>
                    </div>
                    <div id="locLoading" v-show = "showloading" class="spinner" v-bind:style="{marginTop: spinnerMargin}" >
                    </div>
                </div>
            </script>
            <!-- 跟踪设置 -->
            <div class="panel" id="followSetting" title="跟踪设置">
                <script type="text/javascript">
                            $('#followSetting').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                $("#duration").val(60);
                                $('#duration-div').css('display', 'none');
                                $("#interval").val(30);
                                $('#interval-div').css('display', 'none');
                                $("#followBtn").attr("href", "javascript: follow();");
                                $("#followBtn").attr("class", "button block blue");
                            });
                        </script>
                <br />
                <label for="duration">跟踪时长(分)</label>
                <select id="duration" onchange="javascript: if($('#duration').val() == '自定义'){$('#duration-div').css('display', 'block');$('#duration-set').val('');}else{$('#duration-div').css('display', 'none');}">
                    <option>5</option>
                    <option>10</option>
                    <option>30</option>
                    <option>60</option>
                    <option>120</option>
                    <option>自定义</option>
                </select>
                <br />
                <div id="duration-div" style="display: none;">
                    <input type="text" id="duration-set" style="width: 65%; float: right; margin-right: 5px;" placeholder="范围(分钟): 5~10080(一周)"
                            />
                    <br />
                    <br />
                </div>
                <label for="interval">跟踪间隔(秒)</label>
                <select id="interval" onchange="javascript: if($('#interval').val() == '自定义'){$('#interval-div').css('display', 'block');$('#interval-set').val('');}else{$('#interval-div').css('display', 'none');}">
                    <option>10</option>
                    <option>30</option>
                    <option>60</option>
                    <option>90</option>
                    <option>120</option>
                    <option>300</option>
                    <option>自定义</option>
                </select>
                <br />
                <div id="interval-div" style="display: none;">
                    <input type="text" id="interval-set" style="width: 65%; float: right; margin-right: 5px;" placeholder="范围(秒): 10~3600(一小时)"/>
                    <br />
                    <br />
                    <br />
                </div>
                <a id="followBtn" class='button block blue' href="javascript: follow();">开始</a>
            </div>
            <!-- 通知 -->
            <div class="panel" title="通知" id="notice">
                <script type="text/javascript">
                            $('#notice').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#backBtn").show();
                                $("#noticeList").html("");
                                pageIndex = 1;
                                // 加载通知
                                sendCmd({
                                    c : "uGetNotify",
                                    imei : localStorage.getItem("device").split(",")[0],
                                    pageIndex : pageIndex,
                                    pageSize : pageSize
                                });
                            });

                        </script>
                <ul id="noticeList" class="list">

                </ul>
                <div id="noticeMore" style="padding: 8px; margin: 0px 0px -10px -10px; width: 110%; background-color:#fff; display:none; text-align:center; color:#0088d1;" onclick="javascript: addMore(2);">
                    加载更多
                </div>
            </div>
            <!-- 终端设置 -->
            <div class="panel" title="设置" id="deviceSetting">
                <script type="text/javascript">
                            $('#deviceSetting').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#backBtn").show();
                            });
                            $('#deviceSetting').on('panelload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(false);
                                $("#backBtn").show();
                                if (Device.isIoTCard()) {
                                    $('#monitorLi').hide();
                                }
                            });
                        </script>
                <ul class="list">
                    <li id="safeArea">
                        <a href="#circles" class="icon calendar big">安全区域设置</a>
                    </li>
                    <li id="monitorLi">
                        <a href="javascript: monitor();" class="icon phone big">监听</a>
                    </li>
                    <li id="hiddingLi">
                        <a href="#hidding" class="icon cloud big">上课隐身设置</a>
                    </li>
                    <li id="powerLi">
                        <a href="#poweroff" class="icon busy big">定时开关机</a>
                    </li>
                    <li id="clockLi">
                        <a href="#clock" class="icon clock big">闹钟</a>
                    </li>
                    <li id="followLi">
                        <a href="#timerFollow" class="icon user big">定时跟踪</a>
                    </li>
                    <li id="attdanceLi">
                        <a href="#attdance" class="icon magnifier big">考勤查询</a>
                    </li>
                </ul>
            </div>
            <!-- 轨迹查询 -->
            <div class="panel" title="轨迹查询" id="queryTrack">
                <script type="text/javascript">
                            $('#queryTrack').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                $("#track-date").val(formatDate(new Date()).substring(0, 10));
                                $("#track-begin").val("06:00");
                                $("#track-end").val("22:00");
                            });
                            $('#queryTrack').on('panelbeforeunload', function(e) {
                                // 返回时不经过此页面
                                $.afui.delHistory();
                            });
                        </script>
                <br />
                <label for="track-date">查询日期</label>
                <input id="track-date" type="date" />
                <label for="track-begin">开始时间</label>
                <input id="track-begin" type="time"  />
                <label for="track-end">结束时间</label>
                <input id="track-end" type="time"  />
                <a id="trackBtn" class='button block blue' href='javascript: track();'>开始查询</a>
            </div>
            <!-- 轨迹显示 -->
            <div class="panel" title="查看轨迹" id="showTrack" style=“margin:0;padding:0;”>
                <script type="text/javascript">
                            $('#showTrack').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                            });
                        </script>
                <div id="trackMap" style="width: 100%; height: 90%;"></div>
                <div style="width: 90%; height: 10%; margin: 0 auto;">
                    <div class="player-btns">
                        <a id="play" class="pl-play" href="javascript:;" onclick="javascript: playTrack();"> </a>
                        <div class="progress">
                            <div id="progress" style="width: 0%; height: 100%; background-color: #0088d1;"></div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 安全区域设置 -->
            <div class="panel" title="安全区域" id="circles" >
                <script type="text/javascript">

                            $('#circles').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                $("#addBtn2").show();

                            });
                          $('#circles').on('panelunload', function(e) {
                                // 控制按钮显示
                                $("#addBtn2").hide();
                            });
                            $('#circles').on('panelload', function(e) {
                                $("#backBtn").hide();
                                $("#addBtn2").show();

                               if(isConnected){
                           		    // $("#fencesetting_comm_id").hide();
                                    // 加载围栏列表
                                    sendCmd({
                                        c : "fencesetting",
                                        imei : localStorage.getItem("device").split(",")[0],
                                        type : 1
                                    });
                                   // Device.showMask_blockUI();
                                    overTimeCallback_time_2("circleList","fencesetting_comm_id",10000);
                               }else{
                                   	if($("#circleList").text().length != 0){
                                           console.log("index没网里面不为空："+$("#circleList").text().length);
                                           $("#fencesetting_comm_id").hide();
                                   	}else{
                                           console.log("没网里面为空："+$("#circleList").text());
                                            $("#fencesetting_comm_id").hide();
                                           // 加载围栏列表
                                            sendCmd({
                                                c : "fencesetting",
                                                imei : localStorage.getItem("device").split(",")[0],
                                                type : 1
                                            });
                                            Device.showMask_blockUI();
                                            overTimeCallback_time_2("circleList","fencesetting_comm_id",10000);
                                   	}
                               }
                            });
                        </script>
                <div id="fencesetting_comm_id"  style="display: none;">
                    <br>
                    <a style="color: #333;float: left; text-align:center; font-size: 18px;">加载失败，</a>
                    <a  style="color: #0088D1;font-size: 18px;text-decoration:underline" href="javascript: fencesetting_comm();">重试</a>
                </div>
                <ul id="circleList" class="list"></ul>
                <div  style="text-align:center; color:#0088d1; margin-top: 15px; padding: 10px;margin: 0px -10px -20px -20px;background-color:#fff;" >
                </div>
            </div>
            <!-- 围栏详情 -->
            <div class="panel" title="编辑安全区域" id="circleDetail">
                <script type="text/javascript">
                            $('#circleDetail').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#addBtn2").hide();
                                $("#backBtn").hide();
                            });
                        </script>
                <br />
                <ul style="margin: -15px 0px -10px 0px;">
                    <li>
                        <label>提醒</label>
                        <input id="circle-notify" type="checkbox" class="toggle" />
                        <label for="circle-notify" data-on="&nbsp;&nbsp;&nbsp;开" data-off="&nbsp;关" style="margin-top: 5px;"><span></span></label><a href="#circleMap" style="float: right; margin: -28px 25px;">查看地图</a>
                    </li>
                </ul>
                <br />
                <input id="circle-id" type="hidden" />
                <label for="circle-name">名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <input id="circle-name" type="text" maxlength="20" />
                <label for="lng">经度&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <input id="lng" type="number" readonly="readonly" />
                <label for="lat">纬度&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                <input id="lat" type="number" readonly="readonly" />
                <label for="duration">围栏半径</label>
                <select id="radius">
                    <option value="200">200米</option>
                    <option value="300">300米</option>
                    <option value="400">400米</option>
                    <option value="500">500米</option>
                </select>
                <a id="circleBtn" class='button block blue' href='javascript:saveCircle();'>确认</a>
            </div>
            <!-- 围栏地图 -->
            <div class="panel" title="安全区域" id="circleMap">
                <script type="text/javascript">
                            $('#circleMap').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                            });
                            $('#circleMap').on('panelload', function(e) {
                                // 加载地图
                               var map = new BMap.Map("map-circle");
                                map.addControl(new BMap.ScaleControl({
                                    anchor : BMAP_ANCHOR_BOTTOM_LEFT
                                }));
                                var opts = {
                                		offset: new BMap.Size(15, 68),
                                		type: BMAP_NAVIGATION_CONTROL_SMALL,
                                		anchor:BMAP_ANCHOR_BOTTOM_LEFT
                                		}
                                map.addControl(new BMap.NavigationControl(opts));
                                //android点击事件：touchend，调试器用“click”,且click 有300毫秒延迟,touchend 是 没延迟的
                                map.addEventListener("click", function(e) {
                                   console.log("监听circleMap");
                                    $("#lngInput").val(Math.round(e.point.lng * 1000000) / 1000000);
                                    $("#latInput").val(Math.round(e.point.lat * 1000000) / 1000000);
                                    $("#lng").val(Math.round(e.point.lng * 1000000) / 1000000);
                                    $("#lat").val(Math.round(e.point.lat * 1000000) / 1000000);
                                    map.clearOverlays();
                                    var _point = new BMap.Point(e.point.lng, e.point.lat);
                                    map.setCenter(_point);
                                    var marker = new BMap.Marker(_point);
                                    map.addOverlay(marker);
                                    var circle = new BMap.Circle(_point, $("#radius").val(), {
                                        strokeColor : "#F33",
                                        strokeWeight : 3,
                                        strokeOpacity : 1
                                    });
                                    map.addOverlay(circle);
                                });


                                 if ($("#lng").val().trim() == "" || $("#lat").val().trim() == "") {
                               	 if(localStorage.getItem("device")!=null){
                               		 var lng = localStorage.getItem("device").split(",")[4];
                                        var lat = localStorage.getItem("device").split(",")[5];
                                        console.log("lng:"+lng);
                                        console.log("lat:"+lat);
                                        if(lng != 0 ||lat !=0){
                                   	 $("#lngInput").val(lng);
                                        $("#latInput").val(lat);
                                        $("#lng").val($("#lngInput").val());
                                        $("#lat").val($("#latInput").val());
                                        var point = new BMap.Point($("#lngInput").val(), $("#latInput").val());
                                        map.centerAndZoom(point, 16);
                                        var marker = new BMap.Marker(point);
                                        map.addOverlay(marker);
                                        // var circle = new BMap.Circle(_point, $("#radius").val(), {
                                        var circle = new BMap.Circle(point, $("#radius").val(), {
                                            strokeColor : "#F33",
                                            strokeWeight : 3,
                                            strokeOpacity : 1
                                        });
                                        map.addOverlay(circle);}
                                        else{
                                       	 var lng=Math.round(31.0417850000 * 1000000) / 1000000;
                                        	var lat=Math.round(112.2058430000 * 1000000) / 1000000;
                                        	console.log("lng:"+lng);
                                        	console.log("lat:"+lat);
                                        	$("#lngInput").val(lat);
                                            $("#latInput").val(lng);
                                                var point=new BMap.Point(lat,lng);
                                           $("#lng").val($("#lngInput").val());
                                           $("#lat").val($("#latInput").val());
                                            map.centerAndZoom(point, 16);
                                            var marker = new BMap.Marker(point);
                                            map.addOverlay(marker);
                                            var circle = new BMap.Circle(point, $("#radius").val(), {
                                                strokeColor : "#F33",
                                                strokeWeight : 3,
                                                strokeOpacity : 1
                                            });
                                            map.addOverlay(circle);
                                        }

                               		 }else{
                               			/*  if (navigator.geolocation) {
                                                navigator.geolocation.getCurrentPosition(function(point) {
                                                    var _point = new BMap.Point(point.coords.longitude, point.coords.latitude);
                                                    map.centerAndZoom(_point, 16);
                                                    $("#lngInput").val(Math.round(_point.lng * 1000000) / 1000000);
                                                    $("#latInput").val(Math.round(_point.lat * 1000000) / 1000000);
                                                    $("#lng").val(Math.round(_point.lng * 1000000) / 1000000);
                                                    $("#lat").val(Math.round(_point.lat * 1000000) / 1000000);
                                                    var marker = new BMap.Marker(_point);
                                                    map.addOverlay(marker);
                                                    var circle = new BMap.Circle(_point, $("#radius").val(), {
                                                        strokeColor : "#F33",
                                                        strokeWeight : 3,
                                                        strokeOpacity : 1
                                                    });
                                                    map.addOverlay(circle);
                                                });
                                            }
                               			 else{ */
                               			 var lng=Math.round(31.0417850000 * 1000000) / 1000000;
                                         	var lat=Math.round(112.2058430000 * 1000000) / 1000000;
                                         	console.log("lng:"+lng);
                                         	console.log("lat:"+lat);
                                                 var point=new BMap.Point(lat,lng);
                                            $("#lng").val($("#lngInput").val());
                                            $("#lat").val($("#latInput").val());
                                             map.centerAndZoom(point, 16);
                                             var marker = new BMap.Marker(point);
                                             map.addOverlay(marker);
                                             var circle = new BMap.Circle(point, $("#radius").val(), {
                                                 strokeColor : "#F33",
                                                 strokeWeight : 3,
                                                 strokeOpacity : 1
                                             });
                                             map.addOverlay(circle);
                               			 }
                               		 //}
                                }
                                else {
                                   $("#lngInput").val($("#lng").val());
                                   $("#latInput").val($("#lat").val());
                                   var point = new BMap.Point($("#lng").val(), $("#lat").val());
                                   map.centerAndZoom(point, 16);
                                   var marker = new BMap.Marker(point);
                                   map.addOverlay(marker);
                                   // var circle = new BMap.Circle(_point, $("#radius").val(), {
                                   var circle = new BMap.Circle(point, $("#radius").val(), {
                                       strokeColor : "#F33",
                                       strokeWeight : 3,
                                       strokeOpacity : 1
                                   });
                                   map.addOverlay(circle);
                               }
                           });
                        </script>
                <br />
                <label for="lngInput">经度&nbsp;&nbsp;&nbsp;</label>
                <input id="lngInput" type="number" readonly="readonly" />
                <label for="latInput">纬度&nbsp;&nbsp;&nbsp;</label>
                <input id="latInput" type="number" readonly="readonly" />
                <br />
                <a class='button block blue' href='javascript: $.afui.goBack();'>确认</a>
                <div id="map-circle" style="width: 100%; height: 60%;"></div>
            </div>
            <!-- 上课隐身 -->
            <div class="panel" title="上课隐身设置" id="hidding">
                <script type="text/javascript">
                            $('#hidding').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                sendCmd({
                                    c : "classHidding",
                                    imei : localStorage.getItem("device")
                                    .split(",")[0],
                                    type : 1
                                });
                            });

                            function tHidShow(index) {
                                for (var i = 1; i < 4; i++) {
                                    if (index == i) {
                                        $('#hid-a' + i).attr("class", "button blue");
                                        $('#hid-t' + i).css("display", "block");
                                    } else {
                                        $('#hid-a' + i).attr("class", "button gray");
                                        $('#hid-t' + i).css("display", "none");
                                    }
                                }
                            }

                            function tHidSwitch() {
                                if ($("#hid-switch").prop("checked")) {
                                    $("#hid-area").css("display", "block");
                                    for (var i = 0; i < 3; i++) {
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                } else {
                                    $("#hid-area").css("display", "none");
                                    for (var i = 0; i < 3; i++) {
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#hid" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                }
                            }
                     function checkTime1(x) {
                                var y=document.getElementById(x).value;
                                 console.log("x1的长度(点击id名字):"+x.length);
                                 console.log("x:"+x);
		                      if (x.length <= 10){
		                            var y1= x.substring(0,3);
		                      }else{
		                            var y1= x.substring(0,4);
		                      }
                                var y2= x.substr(x.length-1,1);
                                var x_endIdName=y1+"-end"+y2;
                                var x1= x_endIdName.substr(0,x_endIdName.length-1);
                                var d1=parseInt(y.substring(0,2).toString()+y.substring(3,5).toString());
                          if (parseInt(y2)<=6&&parseInt(y2)>=2){
                                                 var x1Number=(parseInt(y2)-1).toString();
                                                 var xz1=document.getElementById(x1+x1Number).value;
                                                 var xz1_1=parseInt(xz1.substring(0,2).toString()+xz1.substring(3,5).toString());
                                                 var y_1=parseInt(y.substring(0,2).toString()+y.substring(3,5).toString());
                                    if (y_1!=''&& xz1_1>=y_1&&y_1>0) {
                                                 popuo("不能小于上一个结束时间");
                                                 document.getElementById(x).value="";
                                                 document.getElementById(x).focus();
                                    return;
                                    }
                          }
					}
                        </script>
                <br />
                <label>上课隐身</label>
                <input id="hid-switch" type="checkbox" class="toggle" onclick="javascript: tHidSwitch();"/>
                <label for="hid-switch" data-on="&nbsp;&nbsp;&nbsp;开" data-off="&nbsp;关" style="margin: 5px 0px 15px 0px;"><span></span></label>
                <div id="hid-area" style="display: none;">
                    <div id="hiddingChoose" class="button-grouped flex" id="hid_all" style="width: 100%; margin: 15px 0px 15px 0px;">
                        <a id="hid-a1" class="button blue" href="javascript: tHidShow(1);" style="border:none;width: 33%;">工作日</a>
                        <a id="hid-a2" class="button gray" href="javascript: tHidShow(2);" style="border:none;width: 33%;">周六</a>
                        <a id="hid-a3" class="button gray" href="javascript: tHidShow(3);" style="border:none;width: 33%;">周日</a>
                    </div>
                    <div id="hid-t1" style="display: block;">
                        <label for="hid-begin1">时段1</label>
                        <input id="hid-begin1" type="time" style="width: 30%;padding: 0px; " onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid-end1" type="time" style="width: 30%;padding: 0px;" />
                        <label for="hid-begin2">时段2</label>
                        <input id="hid-begin2" type="time" style="width: 30%;padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid-end2" type="time" style="width: 30%;padding: 0px;" />
                        <label for="hid-begin3">时段3</label>
                        <input id="hid-begin3" type="time" style="width: 30%;padding: 0px;" onchange="javascript: checkTime1(this.id)" />
                        ——
                        <input id="hid-end3" type="time" style="width: 30%;padding: 0px;" />
                        <div id="hidding-more">
                            <label for="hid-begin4">时段4</label>
                            <input id="hid-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                            ——
                            <input id="hid-end4" type="time" style="width: 30%; padding: 0px;" />
                            <label for="hid-begin5">时段5</label>
                            <input id="hid-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                            ——
                            <input id="hid-end5" type="time" style="width: 30%; padding: 0px;" />
                            <label for="hid-begin6">时段6</label>
                            <input id="hid-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)" />
                            ——
                            <input id="hid-end6" type="time" style="width: 30%; padding: 0px;" />
                        </div>
                    </div>
                    <div id="hid-t2" style="display: none;">
                        <label for="hid2-begin1">时段1</label>
                        <input id="hid2-begin1" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid2-end1" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid2-begin2">时段2</label>
                        <input id="hid2-begin2" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid2-end2" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid2-begin3">时段3</label>
                        <input id="hid2-begin3" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)" />
                        ——
                        <input id="hid2-end3" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid2-begin4">时段4</label>
                        <input id="hid2-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid2-end4" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid2-begin5">时段5</label>
                        <input id="hid2-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid2-end5" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid2-begin6">时段6</label>
                        <input id="hid2-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid2-end6" type="time" style="width: 30%; padding: 0px;" />
                    </div>
                    <div id="hid-t3" style="display: none;">
                        <label for="hid3-begin1">时段1</label>
                        <input id="hid3-begin1" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid3-end1" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid3-begin2">时段2</label>
                        <input id="hid3-begin2" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid3-end2" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid3-begin3">时段3</label>
                        <input id="hid3-begin3" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid3-end3" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid3-begin4">时段4</label>
                        <input id="hid3-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)" />
                        ——
                        <input id="hid3-end4" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid3-begin5">时段5</label>
                        <input id="hid3-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)" />
                        ——
                        <input id="hid3-end5" type="time" style="width: 30%; padding: 0px;" />
                        <label for="hid3-begin6">时段6</label>
                        <input id="hid3-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime1(this.id)"/>
                        ——
                        <input id="hid3-end6" type="time" style="width: 30%; padding: 0px;" />
                    </div>
                </div>
                <a class='button block blue' href='javascript: hidding();'  >确认</a>
            </div>
            <!-- 定时跟踪 -->
            <div class="panel" title="定时跟踪" id="timerFollow">
                <script type="text/javascript">
                            $('#timerFollow').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                sendCmd({
                                    c : "followingSetting",
                                    imei : localStorage.getItem("device")
                                    .split(",")[0],
                                    type : 1
                                });
                            });

                            function tFollowShow(index) {
                                for (var i = 1; i < 4; i++) {
                                    if (index == i) {
                                        $('#follow-a' + i).attr("class", "button blue");
                                        $('#follow-t' + i).css("display", "block");
                                    } else {
                                        $('#follow-a' + i).attr("class", "button gray");
                                        $('#follow-t' + i).css("display", "none");
                                    }
                                }
                            }

                            function tFollowSwitch() {
                                if ($("#follow-switch").prop("checked")) {
                                    $("#follow-area").css("display", "block");
                                    $("#followingContent").css("display", "block");
                                     for (var i = 0; i < 3; i++) {
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                } else {
                                    $("#followingContent").css("display", "none");
                                    $("#follow-area").css("display", "none");
                                    $("#followingInterval").val(60);
                                    for (var i = 0; i < 3; i++) {
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#follow" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                }
                            }
                             function checkTime(x) {
                                                var y=document.getElementById(x).value;
                                                var s="22:59";
                                                 console.log("x的长度(点击id名字):"+x.length);
                                        if (x.length <= 13){
                                                var y1= x.substring(0,7);
                                        }else{
                                            	var y1= x.substring(0,8);
                                        }
                                                var y2= x.substr(x.length-1,1);
                                                var x_endIdName=y1+"end"+y2;
                                                var x1= x_endIdName.substr(0,x_endIdName.length-1);
                                                    console.log("x1:"+x1);
                                                var y3=document.getElementById(y1+"end"+y2).value;
                                                var d1=parseInt(y.substring(0,2).toString()+y.substring(3,5).toString());
                                                var d2=parseInt(s.substring(0,2).toString()+s.substring(3,5).toString());
                                        if(d1>d2){
                                             popuo("开始时间不能小于11:00");
                                            $('#'+x).val("22:59");
                                        }
                                        if (parseInt(y2)<=4&&parseInt(y2)>=2){
                                                                    var x1Number=(parseInt(y2)-1).toString();
                                                                    var xz1=document.getElementById(x1+x1Number).value;
                                                                    var xz1_1=parseInt(xz1.substring(0,2).toString()+xz1.substring(3,5).toString());
                                                                    var y_1=parseInt(y.substring(0,2).toString()+y.substring(3,5).toString());
                                                    if (y_1!=''&& xz1_1>=y_1&&y_1>0) {
                                                                     popuo("不能小于上一个结束时间");
                                                                     document.getElementById(x).value="";
                                                                     document.getElementById(x).focus();
                                                    return;
                                                    }
                                        }
                                         if((y!=null ||y!="")&&(y3==null||y3=="")){
                                                                 var a=parseInt(y.substring(0,2))+1;
                                                                 var b=parseInt(y.substring(3, 5));
                                                                 var time="";
                                                                     time += a < 10 ? '0' + a : a;
                                                                     time += ':';
                                                                     time += b < 10 ? '0' + b : b;
                                                                     console.log("y1:"+y1);
                                                                     console.log("y2:"+y2);
                                                                     console.log("a:"+a);
                                                                     console.log("b:"+b);
                                                                    document.getElementById(y1+"end"+y2).value=time;
                                          }

  }
                        </script>
                <br />
                <label>定时跟踪</label>
                <input id="follow-switch" type="checkbox" class="toggle" onclick="javascript: tFollowSwitch();"/>
                <label for="follow-switch" data-on="&nbsp;&nbsp;&nbsp;开" data-off="&nbsp;关" style="margin: 5px 0px 15px 0px;"><span></span></label>
                <div id="follow-area" style="display: none;">
                    <label for="followingInterval" style="display: none;">跟踪间隔(秒)</label>
                    <select id="followingInterval" style="display: none;">
                        <option>300</option>
                        <option>120</option>
                        <option selected>60</option>
                        <option>30</option>
                    </select>
                    <div class="button-grouped flex" style="width: 100%; margin: 15px 0px 15px 0px;">
                        <a id="follow-a1" class="button blue" href="javascript: tFollowShow(1);" style="border:none;width: 33%;">工作日</a>
                        <a id="follow-a2" class="button gray" href="javascript: tFollowShow(2);" style="border:none;width: 33%;">周六</a>
                        <a id="follow-a3" class="button gray" href="javascript: tFollowShow(3);" style="border:none;width: 33%;">周日</a>
                    </div>
                    <div id="follow-t1" style="display: block;">
                        <label for="follow-begin1">时段1</label>
                        <input id="follow-begin1" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow-end1" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow-begin2">时段2</label>
                        <input id="follow-begin2" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow-end2" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow-begin3">时段3</label>
                        <input id="follow-begin3" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow-end3" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow-begin4">时段4</label>
                        <input id="follow-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow-end4" type="time" style="width: 30%; padding: 0px;" />
                        <div style="display: none;">
                            <label for="follow-begin5">时段5</label>
                            <input id="follow-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                            ——
                            <input id="follow-end5" type="time" style="width: 30%; padding: 0px;" />
                            <label for="follow-begin6">时段6</label>
                            <input id="follow-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                            ——
                            <input id="follow-end6" type="time" style="width: 30%; padding: 0px;" />
                        </div>
                    </div>
                    <div id="follow-t2" style="display: none;">
                        <label for="follow2-begin1">时段1</label>
                        <input id="follow2-begin1" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow2-end1" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow2-begin2">时段2</label>
                        <input id="follow2-begin2" type="time" style="width: 30%; padding: 0px;"onchange="javascript: checkTime(this.id)" />
                        ——
                        <input id="follow2-end2" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow2-begin3">时段3</label>
                        <input id="follow2-begin3" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow2-end3" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow2-begin4">时段4</label>
                        <input id="follow2-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow2-end4" type="time" style="width: 30%; padding: 0px;" />
                        <div style="display: none;">
                            <label for="follow2-begin5">时段5</label>
                            <input id="follow2-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                            ——
                            <input id="follow2-end5" type="time" style="width: 30%; padding: 0px;" />
                            <label for="follow2-begin6">时段6</label>
                            <input id="follow2-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                            ——
                            <input id="follow2-end6" type="time" style="width: 30%; padding: 0px;" />
                        </div>
                    </div>
                    <div id="follow-t3" style="display: none;">
                        <label for="follow3-begin1">时段1</label>
                        <input id="follow3-begin1" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow3-end1" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow3-begin2">时段2</label>
                        <input id="follow3-begin2" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow3-end2" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow3-begin3">时段3</label>
                        <input id="follow3-begin3" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow3-end3" type="time" style="width: 30%; padding: 0px;" />
                        <label for="follow3-begin4">时段4</label>
                        <input id="follow3-begin4" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                        ——
                        <input id="follow3-end4" type="time" style="width: 30%; padding: 0px;" />
                        <div style="display: none;">
                            <label for="follow3-begin5">时段5</label>
                            <input id="follow3-begin5" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)"/>
                            ——
                            <input id="follow3-end5" type="time" style="width: 30%; padding: 0px;" />
                            <label for="follow3-begin6">时段6</label>
                            <input id="follow3-begin6" type="time" style="width: 30%; padding: 0px;" onchange="javascript: checkTime(this.id)" />
                            ——
                            <input id="follow3-end6" type="time" style="width: 30%; padding: 0px;" />
                        </div>
                    </div>
                </div>
                <a class='button block blue' href='javascript: followingSetting();'>确认</a>
                <br />
                <div id="followingContent" style="font-size:19px;font-family: 微软雅黑;line-height:30px;border:2px solid #0389D1 ">
                    <a ><b>&nbsp;&nbsp;提示：定时跟踪适合一段时间连续定位和跟踪需要，此时系统耗电会增加，跟踪时间越长，耗电越快，请设置合理的时段。</b></a>
                </div>
            </div>
            <!-- 定时开关机 -->
            <div class="panel" title="定时开关机" id="poweroff">
                <script type="text/javascript">
                            $('#poweroff').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                sendCmd({
                                    c : "alarmPowerOnOff",
                                    type : 1,
                                    imei : localStorage.getItem("device").split(",")[0]
                                });
                            });
                        </script>
                <br />
                <label for="power-begin">开机时间</label>
                <input id="power-begin" type="time" />
                <label for="power-end">关机时间</label>
                <input id="power-end" type="time" />
                <a class='button block blue' href='javascript: alarmPowerOnOff();'>确认</a>
            </div>
            <!-- 闹钟 -->
            <div class="panel" title="闹钟" id="clock">
                <script type="text/javascript">
                            $('#clock').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                sendCmd({
                                    c : "alarmsetting",
                                    imei : localStorage.getItem("device")
                                    .split(",")[0],
                                    type : 1
                                });
                            });

                            function tAlarmShow(index) {
                                for (var i = 1; i < 4; i++) {
                                    if (index == i) {
                                        $('#alarm-a' + i).attr("class", "button blue");
                                        $('#alarm-t' + i).css("display", "block");
                                    } else {
                                        $('#alarm-a' + i).attr("class", "button gray");
                                        $('#alarm-t' + i).css("display", "none");
                                    }
                                }
                            }

                            function tAlarmSwitch() {
                                if ($("#alarm-switch").prop("checked")) {
                                    $("#alarm-area").css("display", "block");
                                     for (var i = 0; i < 3; i++) {
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                } else {
                                    $("#alarm-area").css("display", "none");
                                    for (var i = 0; i < 3; i++) {
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin1").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end1").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin2").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end2").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin3").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end3").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin4").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end4").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin5").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end5").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-begin6").val("");
                                        $("#alarm" + (i == 0 ? "" : i + 1) + "-end6").val("");
                                    }
                                }
                            }
                        </script>
                <br />
                <label>闹钟</label>
                <input id="alarm-switch" type="checkbox" class="toggle" onclick="javascript: tAlarmSwitch();"/>
                <label for="alarm-switch" data-on="&nbsp;&nbsp;&nbsp;开" data-off="&nbsp;关" style="margin: 5px 0px 15px 0px;"><span></span></label>
                <div id="alarm-area" style="display: none;">
                    <div class="button-grouped flex" id="alarm_all" style="width: 100%; margin: 15px 0px 15px 0px;">
                        <a id="alarm-a1" class="button blue" href="javascript: tAlarmShow(1);" style="border:none;width: 33%;">工作日</a>
                        <a id="alarm-a2" class="button gray" href="javascript: tAlarmShow(2);" style="border:none;width: 33%;">周六</a>
                        <a id="alarm-a3" class="button gray" href="javascript: tAlarmShow(3);" style="border:none;width: 33%;">周日</a>
                    </div>
                    <div id="alarm-t1" style="display: block;">
                        <label for="alarm-begin1">闹钟1&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm-begin1" type="time" />
                        <label for="alarm-begin2">闹钟2&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm-begin2" type="time"  />
                        <label for="alarm-begin3">闹钟3&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm-begin3" type="time" />
                        <div id="hidding-alarm-more">
                            <label for="alarm-begin4">闹钟4&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm-begin4" type="time"  />
                            <label for="alarm-begin5">闹钟5&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm-begin5" type="time"  />
                            <label for="alarm-begin6">闹钟6&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm-begin6" type="time"  />
                        </div>
                    </div>
                    <div id="alarm-t2" style="display: none;">
                        <label for="alarm2-begin1">闹钟1&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm2-begin1" type="time" />
                        <label for="alarm2-begin2">闹钟2&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm2-begin2" type="time"  />
                        <label for="alarm2-begin3">闹钟3&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm2-begin3" type="time"  />
                        <div id="hidding-alarm-more2">
                            <label for="alarm2-begin4">闹钟4&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm2-begin4" type="time"  />
                            <label for="alarm2-begin5">闹钟5&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm2-begin5" type="time"  />
                            <label for="alarm2-begin6">闹钟6&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm2-begin6" type="time"  />
                        </div>
                    </div>
                    <div id="alarm-t3" style="display: none;">
                        <label for="alarm3-begin1">闹钟1&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm3-begin1" type="time"  />
                        <label for="alarm3-begin2">闹钟2&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm3-begin2" type="time"  />
                        <label for="alarm3-begin3">闹钟3&nbsp;&nbsp;&nbsp;</label>
                        <input id="alarm3-begin3" type="time"  />
                        <div id="hidding-alarm-more3">
                            <label for="alarm3-begin4">闹钟4&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm3-begin4" type="time"  />
                            <label for="alarm3-begin5">闹钟5&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm3-begin5" type="time"  />
                            <label for="alarm3-begin6">闹钟6&nbsp;&nbsp;&nbsp;</label>
                            <input id="alarm3-begin6" type="time"  />
                        </div>
                    </div>
                </div>
                <a class='button block blue' href='javascript: alarmsetting();'>确认</a>
            </div>
            <!-- Attdance View -->
            <div class="panel" title="考勤查询" id="attdance">
                <script type="text/javascript">
                            $('#attdance').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                                $("#attdance-begin").val(formatDate(new Date()).substring(0, 10));
                                $("#attdance-end").val(formatDate(new Date()).substring(0, 10));
                            });
                        </script>
                <br />
                <label for="attdance-begin">开始日期</label>
                <input id="attdance-begin" type="date" />
                <label for="attdance-end">结束日期</label>
                <input id="attdance-end" type="date" />
                <a class='button block blue' href='javascript: uSchoolRecord();'>确认</a>
            </div>
            <!-- Attdances View -->
            <div class="panel" title="考勤记录" id="attdances">
                <script type="text/javascript">
                            $('#attdances').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.setBackButtonVisibility(true);
                                $("#backBtn").hide();
                            });
                        </script>
                <ul id="attdanceUl" class="list"></ul>
                <div id="attdanceMore" style="text-align:center; color:#0088d1; margin-top: 15px; padding: 10px;margin: 0px -10px -20px -20px;background-color:#fff;" onclick="javascript: addMore(1);">
                    加载更多
                </div>
                <!-- <div id="attdanceMore" style="text-align:center; color:#0088d1; margin-top: 15px;" onclick="javascript: addMore(1);">
                     加载更多
                 </div>-->
            </div>
        </div>
        <footer>
            <a id="locationLink" href="#location" class="icon location big">定位</a>
            <!-- <a href="#followSetting" class="icon user big">跟踪</a>  -->
            <a id="noticeLink" href="#notice" class="icon headset big">通知</a>
            <a id="dialLink" href="#" class="icon phone big">拨号</a>
            <a id="settingLinkBtn" href="#deviceSetting" class="icon settings big">更多</a>
        </footer>
    </div>
    <div id="loginView" class="view">
        <header>
            <h1></h1>
        </header>
        <div class="pages">
            <!-- 登录 -->
            <div class="panel" id="login" data-title="登录">
                <script type="text/javascript">
                            $('#login').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.clearHistory();
                                // 重置表单
                                $("#loginForm")[0].reset();
                            });

                        </script>
                <br>
                <div class="card">
                    <form id="loginForm">
                        <div class="input-group">
                            <label for="login-mobile">帐&nbsp;&nbsp;&nbsp;号</label>
                            <input maxlength="20" type="text" id="login-mobile" placeholder="请输入您的手机或用户名">
                            <label for="login-password">密&nbsp;&nbsp;&nbsp;码</label>
                            <input maxlength="20" type="password" id="login-password" placeholder="请输入您的密码">
                        </div>
                        <a href="#register" style="display: block; margin-top: 18px;">没有帐号？马上注册</a>
                        <br />
                        <a href="#forgot" style="display: block; margin: -5px 0px -10px;">忘记密码？</a>
                        <br />
                        <a id="loginBtn" class='button block blue' href='javascript:login();'>登录</a>
                    </form>
                </div>
            </div>
            <!-- 注册 -->
            <div class="panel" id="register" data-title="注册">
                <script type="text/javascript">
                            $('#register').on('panelbeforeload', function(e) {
                                // 重置表单
                                $("#registerForm")[0].reset();
                            });
                        </script>
                <br>
                <div class="card">
                    <form id="registerForm">
                        <label for="register-mobile">手&nbsp;&nbsp;&nbsp;机&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input id="register-mobile" type="tel" placeholder="请输入您的手机号码" maxlength="20" />
                        <label for="register-name">昵&nbsp;&nbsp;&nbsp;称&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input id="register-name" type="text" placeholder="请输入您的昵称" maxlength="20" />
                        <label for="register-sex" style="display: none;">性&nbsp;&nbsp;&nbsp;别&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <select id="register-sex" style="display: none;">
                            <option value="false">男</option>
                            <option value="true" selected>女</option>
                        </select>
                        <label for="register-password">密&nbsp;&nbsp;&nbsp;码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input id="register-password" type="password" placeholder="请输入密码(6-20位)"
                               maxlength="20" />
                        <label for="register-repassword">确认密码</label>
                        <input id="register-repassword" type="password" placeholder="请再次输入密码" maxlength="20"/>
                        <label for="register-code">验证码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input id="register-code" type="number" maxlength="4" style="width: 22%;" />
                        &nbsp;<a id="getCodeBtn" class="button blue" style="float: right; margin-top: 0px; font-size: 14px; width:40%;"
                                 href="javascript: smsVerify(1);">获取验证码</a><a id="registerBtn" class='button block blue' href='javascript: register();'>注册</a>
                    </form>
                </div>
            </div>
            <!-- 忘记密码 -->
            <div class="panel" id="forgot" data-title="忘记密码">
                <script type="text/javascript">
                            $('#forgot').on('panelbeforeload', function(e) {
                                // 重置表单
                                $("#forgotForm")[0].reset();
                            });
                        </script>
                <br>
                <div class="card">
                    <form id="forgotForm">
                        <label for="forgot-mobile">手&nbsp;&nbsp;&nbsp;机</label>
                        <input id="forgot-mobile" type="number" placeholder="请输入您的手机号码" oninput="if(value.length>20)value=value.slice(0,20)"/>
                        <label for="forgot-code">验证码</label>
                        <input id="forgot-code" type="number" maxlength="4" style="width: 22%;" />
                        &nbsp; <a id="getCodeBtn2" class="button blue" style="float: right; margin-top: 0px; font-size: 14px; width:40%;" href="javascript: smsVerify(2);">获取验证码</a>
                        <a id="forgotBtn" class='button block blue' href='javascript: forgot();'>重置密码</a>
                    </form>
                </div>
            </div>
            <!-- 重置密码 -->
            <div class="panel" id="reset" data-title="设置新密码">
                <script type="text/javascript">
                            $('#reset').on('panelbeforeload', function(e) {
                                // 控制按钮显示
                                $.afui.delHistory();
                                // 重置表单
                                $("#resetForm")[0].reset();
                            });
                        </script>
                <br>
                <div class="card">
                    <form id="resetForm">
                        <input id="reset-token" type="hidden" />
                        <label for="reset-mobile">密&nbsp;&nbsp;&nbsp;码&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input id="reset-password" type="password" placeholder="请输入新的密码(6-20位)"
                               maxlength="20" />
                        <label for="reset-repassword">确认密码</label>
                        <input id="reset-repassword" type="password" placeholder="请再次输入新密码" maxlength="20"/>
                        <a id="resetBtn" class='button block blue' href='javascript: reset();'>确认</a>
                    </form>
                </div>
            </div>

            <!-- 绑定手机号 -->
            <div class="panel" id="bindMobile" data-title="绑定手机号">
                <script type="text/javascript">
                            $('#bindMobile').on('panelbeforeload', function(e) {
                                // 重置表单
                                $("#bindMobileForm")[0].reset();
                            });
                        </script>
                <br>
                <div class="card">
                    <form id="bindMobileForm">
                        <label for="bindMobile-mobile">手&nbsp;&nbsp;&nbsp;机</label>
                        <input id="bindMobile-mobile" type="number" placeholder="请输入您的手机号码" oninput="if(value.length>20)value=value.slice(0,20)"/>
                        <label for="bindMobile-code">验证码</label>
                        <input id="bindMobile-code" type="number" maxlength="4" style="width: 22%;" />
                        &nbsp; <a id="getCodeBtn3" class="button blue" style="float: right; margin-top: 0px; font-size: 14px; width:40%;" href="javascript: smsVerify(3);">获取验证码</a>
                        <a id="bindMobileBtn" class='button block blue' href='javascript: bindMobile();'>绑定</a>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
</body>

</html>